Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DDC-1572] Allow LIKE pattern to be a function or path expression #245

Merged
merged 1 commit into from Dec 31, 2011
Merged

Conversation

milokmet
Copy link
Contributor

I fix like expression parser as well as SqlWalker to allow the pattern to be a function or path expression (another column for example joined column), to allow such where conditions:

LOWER(u.field) LIKE LOWER(?1) or with joined tables - log.messages LIKE alert.pattern

I do not know if I fixed that in the correct way, because I am not familiar with Doctrine2 query parsers and lexers.
I've created also few test cases for that and it works.

@stof
Copy link
Member

stof commented Dec 29, 2011

I'm wondering about the use of functions in the pattern of a LIKE clause. Is it supported by all RDBMS targeted by Doctrine ?

@milokmet
Copy link
Contributor Author

Guilherme - I've fixed the docblock.

Stof - I think yes. I've tested it only on sqlite, mysql, postgresql and oracle, and I think, that mssql and db2 will support it too.
And I need this for oracle convert function that trims diacritics from the pattern.

@guilhermeblanco
Copy link
Member

@stof yes, it is supported.

guilhermeblanco added a commit that referenced this pull request Dec 31, 2011
[DDC-1572] Allow LIKE pattern to be a function or path expression
@guilhermeblanco guilhermeblanco merged commit 9f3967d into doctrine:master Dec 31, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants